package org.jeecg.modules.health_records.health_record.service.impl;

import org.jeecg.modules.health_records.health_record.entity.HealthRecordInfo;
import org.jeecg.modules.health_records.health_record.mapper.HealthRecordInfoMapper;
import org.jeecg.modules.health_records.health_record.service.IHealthRecordInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Description: 个人人口学基本信息表
 * @Author: jeecg-boot
 * @Date:   2025-06-18
 * @Version: V1.0
 */
@Service
public class HealthRecordInfoServiceImpl extends ServiceImpl<HealthRecordInfoMapper, HealthRecordInfo> implements IHealthRecordInfoService {
    @Autowired
    private HealthRecordInfoMapper healthRecordInfoMapper;
    /**按recordid查询**/
    @Override
    @Transactional(rollbackFor = Exception.class)
    public List<HealthRecordInfo> queryByRecordId(HealthRecordInfo healthRecordInfo) {
        if(healthRecordInfo.getRecordid()==null){
            return healthRecordInfoMapper.queryByRecordId(null,healthRecordInfo.getIdNumber(),healthRecordInfo.getName());

        }else{
            return healthRecordInfoMapper.queryByRecordId(Long.valueOf(healthRecordInfo.getRecordid()),healthRecordInfo.getIdNumber(),healthRecordInfo.getName());

        }

    }








}
